package com.netease.pris.activity.view;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.Callback;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

public class RelativeLayoutEx extends RelativeLayout
{
  private static final String a = "RelativeLayoutEx";
  private Drawable b;
  private boolean c;
  private Bitmap d;
  private int e = 0;
  private int f = 0;
  private boolean g = false;
  private Drawable h;
  private Rect i = new Rect();
  private Drawable.Callback j = new bq(this);
  private int k;
  private int l;
  private int m;
  private int n;
  private boolean o = false;

  public RelativeLayoutEx(Context paramContext)
  {
    this(paramContext, null, 0);
  }

  public RelativeLayoutEx(Context paramContext, AttributeSet paramAttributeSet)
  {
    this(paramContext, null, 0);
  }

  public RelativeLayoutEx(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
  }

  private void a()
  {
    Drawable localDrawable = getBackground();
    if (localDrawable != null)
    {
      this.h = localDrawable;
      this.k = getPaddingLeft();
      this.l = getPaddingTop();
      this.m = getPaddingRight();
    }
    for (this.n = getPaddingBottom(); ; this.n = this.i.bottom)
    {
      this.h.setBounds(getLeft() + getScrollX(), getTop() + getScrollY(), getRight() + getScrollX(), getBottom() + getScrollY());
      return;
      this.h = getResources().getDrawable(2130837637);
      this.h.getPadding(this.i);
      this.k = this.i.left;
      this.l = this.i.top;
      this.m = this.i.right;
    }
  }

  private void a(Canvas paramCanvas, Bitmap paramBitmap)
  {
    if ((paramCanvas == null) || (paramBitmap == null));
    while (true)
    {
      return;
      paramCanvas.drawBitmap(paramBitmap, 20.0F, 20.0F, null);
    }
  }

  public void a(int paramInt)
  {
    if (this.b != null)
      return;
    this.b = getResources().getDrawable(paramInt);
    this.b.setCallback(this.j);
    if (this.b.isStateful())
      this.b.setState(getDrawableState());
    Drawable localDrawable = this.b;
    if (getVisibility() == 0);
    for (boolean bool = true; ; bool = false)
    {
      localDrawable.setVisible(bool, false);
      break;
    }
  }

  public void a(Bitmap paramBitmap)
  {
    this.d = paramBitmap;
  }

  public void a(boolean paramBoolean)
  {
    this.c = paramBoolean;
  }

  protected void dispatchDraw(Canvas paramCanvas)
  {
    if (this.h == null)
      a();
    this.h.draw(paramCanvas);
    int i1 = paramCanvas.save();
    paramCanvas.clipRect(this.k, this.l, getWidth() - this.m, getBottom() - this.n);
    super.dispatchDraw(paramCanvas);
    paramCanvas.restoreToCount(i1);
    if (((this.d == null) || (!this.c)) || (this.b == null));
    while (true)
    {
      return;
      if (this.g)
      {
        this.g = false;
        if (!this.o)
        {
          this.b.setBounds(getLeft() + getScrollX(), getTop() + getScrollY(), getRight() + getScrollX(), getBottom() + getScrollY());
          this.o = true;
        }
        this.b.draw(paramCanvas);
        continue;
      }
    }
  }

  protected void drawableStateChanged()
  {
    super.drawableStateChanged();
    this.g = true;
    if ((this.b != null) && (this.b.isStateful()))
      this.b.setState(getDrawableState());
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.view.RelativeLayoutEx
 * JD-Core Version:    0.6.0
 */